<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewCommandeTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup styleClass="view" layout="block" style="float: left; width: 100%;">
                <h:panelGroup style="float:left; width: 50%;">

                    <h:panelGrid columns="2">
                        <h:outputText value="#{bundle.ViewCommandeLabel_idCommande}"/>
                        <h:outputText value="#{commandeController.selected.idCommande}" title="#{bundle.ViewCommandeTitle_idCommande}"/>
                        <h:outputText value="#{bundle.ViewCommandeLabel_dateCommande}"/>
                        <h:outputText value="#{commandeController.selected.dateCommande}" title="#{bundle.ViewCommandeTitle_dateCommande}">
                            <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                        </h:outputText>
                        <h:outputText value="#{bundle.ViewCommandeLabel_dateLivraison}"/>
                        <h:outputText value="#{commandeController.selected.dateLivraison}" title="#{bundle.ViewCommandeTitle_dateLivraison}">
                            <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                        </h:outputText>
                        <h:outputText value="#{bundle.ViewCommandeLabel_montant}"/>
                        <h:outputText value="#{commandeController.selected.montant}" title="#{bundle.ViewCommandeTitle_montant}"/>
                        <h:outputText value="#{bundle.ViewCommandeLabel_idStatut}"/>
                        <h:panelGroup styleClass="statut_#{commandeController.selected.idStatut.idStatut}" layout="block"><h:outputText value="#{commandeController.selected.idStatut.libelle}" title="#{bundle.ViewCommandeTitle_idStatut}"/></h:panelGroup>
                        <h:outputText value="#{bundle.ViewCommandeLabel_raisonRefus}"/>
                        <h:outputText value="#{commandeController.selected.raisonRefus}" title="#{bundle.ViewCommandeTitle_raisonRefus}"/>
                        <h:outputText value="#{bundle.ViewCommandeLabel_idAdresse}"/>
                        <h:outputText value="#{commandeController.selected.idAdresse.adresse} - #{commandeController.selected.idAdresse.codePostal} #{commandeController.selected.idAdresse.ville}" 
                                      title="#{bundle.ViewCommandeTitle_idAdresse}"/>
                        <h:outputText value="#{bundle.ViewCommandeLabel_idClient}"/>
                        <h:outputText value="#{commandeController.selected.idClient.prenom} #{commandeController.selected.idClient.nom}" 
                                      title="#{bundle.ViewCommandeTitle_idClient}"/>


                    </h:panelGrid>

                </h:panelGroup>

                <h:panelGroup style="float: right; width: 50%; text-align: center;">

                    <h:outputText value="Menus" />

                    <h:dataTable value="#{commandeController.selected.menuCollection}" var="itemMenu" border="0" style="border:none;" 
                                 rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" >
                        <h:column  border="0" style="border:none;" >
                            <h:outputText value="#{itemMenu.nom}"/>
                        </h:column>
                    </h:dataTable>

                    <br />

                    <h:outputText value="Produits" />

                    <h:dataTable value="#{commandeController.selected.produitCollection}" var="itemProduit"  border="0" style="border:none;"  
                                 rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" >
                        <h:column  border="0" style="border:none;" >
                            <h:outputText value="#{itemProduit.nom}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>

                <br />

                <h:panelGroup style="float: left; width: 100%;" styleClass="boutons" layout="block">

                    <br />
                    <h:commandLink styleClass="modifier" action="Edit" value="#{bundle.ViewCommandeEditLink}"/>
                    <br />
                    <h:commandLink styleClass="retour" action="#{commandeController.prepareList}" value="#{bundle.ViewCommandeShowAllLink}"/>
                </h:panelGroup>
            </h:panelGroup>
        </ui:define>
    </ui:composition>

</html>
